home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
1116.ZIP
/
TOOLKIT.ARC
/
STRING.C
< prev
next >
Wrap
Text File
|
1979-12-31
|
461b
|
20 lines
#include string.h
#include stdio.h
main()
{
char in[81],insub[81]; int x,z;
x = z = 0;
puts("Enter a string: "); gets(in);
z = strlen(in,z); puts("String length = ");
printf("%d",z); putchar(13);
puts("Enter a substring to search for: "); gets(insub);
x = strpos(in,insub,x);
puts("Starting position of substring is: ");
printf("%d",x); putchar(13);
}